﻿using System;
using System.IO;
using System.Windows.Forms;

namespace Swsk33.SimpleArcEngine.Dialog
{
	public partial class ImageDialog : Form
	{
		public ImageDialog()
		{
			InitializeComponent();
		}

		public string ShowImageDialog()
		{
			ShowDialog();
			if (File.Exists(imagePath.Text))
			{
				return imagePath.Text;
			}
			else
			{
				return "";
			}
		}

		private void openImage_Click(object sender, EventArgs e)
		{
			OpenFileDialog dialog = new OpenFileDialog();
			dialog.Filter = "图片|*.bmp;*.jpg;*.png;*.gif";
			if (dialog.ShowDialog() == DialogResult.OK)
			{
				imagePath.Text = dialog.FileName;
			}
		}

		private void ok_Click(object sender, EventArgs e)
		{
			Close();
		}
	}
}